<?php

	class bEncode {
	
		const MYSQL	=1;
		const URL =2;
	
		public function Input($sData, $wType =0) {
		
			if($wType & bEncode::MYSQL) {
			
				$sData =mysql_escape_string($sData);
			}
			
			if($wType & bEncode::URL) {
			
				$sData =rawurlencode($sData);
			}
			
			return $sData;
		}
		
		public function Output($sData, $wType =0) {
		
			if($wType & bEncode::URL) {
			
				$sData =rawurldecode($sData);
			}
			
			return $sData;
		}
	}

?>